var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var UI_GetZaZhong_UIBindings = require("AA_UI_GetZaZhong_UIBindings");
var BundleConfig = require("AA_BundleConfig");
var CommonUtils = require("AA_CommonUtils");
var Excel = require("AA_Excel");
var UIView = require("AA_UIView");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;

var _def_UI_GetZaZhong = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.auto_ui = null;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype._show = function (e) {
    var t = Excel.Excel.shuiguo(e.shuiGuoId);
    if (t) {
      var o = this.auto_ui;
      o.txt_titleLabel.string = t.newName;
      var n = "player" + (e.shuiGuoId - 1e3) + "_5";
      this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/player/" + n, cc.SpriteFrame).then(function (e) {
        o.sp_icon.spriteFrame = e;
      });
      this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/tianfuicon/tianfu_" + e.shuiGuoId + "_1", cc.SpriteFrame).then(function (e) {
        o.sp_ciTiaoIcon.spriteFrame = e;
      });
      o.node_light.stopAllActions();
      o.node_light.runAction(cc.repeatForever(cc.rotateBy(5, 360)));
      var i = -1;
      Excel.Excel.shuiguohecheng_all.forEach(function (t) {
        t.shuiguoId == e.shuiGuoId && 0 != t.newTianFuBuff && (i = t.newTianFuBuff);
      });
      if (-1 != i) {
        var a = Excel.Excel.shuiguobuff(i);
        if (a) {
          var r = a.value;
          var c = a.buffdesc;
          var d = [c = CommonUtils.default.replaceSymbols(c, "\\n", [""])];
          -1 != c.indexOf("X") && (d = c.split("X"));
          var p = "";
          for (var h = 0; h < d.length; h++) {
            var f = d[h];
            if (-1 != f.indexOf("#")) {
              var g = '<color=#ffff00 click="ShowZaZhongInfo">' + t.newName + "</c>";
              g = "<u>" + g + "</u>";
              f = CommonUtils.default.replaceSymbols(f, "#", [g]);
            }
            p += "<color=#ffffff>" + f + "</c>";
            h < d.length - 1 && r && (p += "<color=#71ff00>" + r[h] + "</c>");
          }
          p = "<outline color=#000000 width=3>" + (p = "<b>" + p + "</b>") + "</outline>";
          this.auto_ui.rtxt_ciTiaoInfo.string = p;
        }
      }
      CommonUtils.default.LoadLevel5Effect(e.shuiGuoId, this.auto_ui.node_qiFather, this.auto_ui.node_huoFather, this._loadRes.bind(this));
    } else {
      this._close();
    }
  };
  _creator.prototype._clickListener = function (e) {
    switch (e) {
      case this.auto_ui.btn_closeBtn:
        this._close();
    }
  };
  __decorate([_property(UI_GetZaZhong_UIBindings.default)], _creator.prototype, "auto_ui", undefined);
  return __decorate([_ccclass], _creator);
}(UIView.default);
exports.default = _def_UI_GetZaZhong;